<%@page contentType="text/html; charset=UTF-8" language="java" %>
<%@page pageEncoding="UTF-8"%>
<%@page import="java.util.*" %>
<%@page import="com.mew.util.*" %>
<%@page import="com.humyu.school.corebase.*" %>
<% request.setCharacterEncoding("UTF-8");%>
<%
	String strHtml = (String)request.getAttribute("strHtml");
	String strHtml1 = (String)request.getAttribute("strHtml1");
	Iterator iteratorClasses = (Iterator)request.getAttribute("classes");
%>
<html>
<head>
<title></title>
<script language="JavaScript">
function getGrades(){
	var SchoolID;
	SchoolID = document.form1.SchoolID.value;
	var preFix;
	preFix = '<%=com.humyu.servlet.DispatcherServlet.PREFIX%>';
	location.href=preFix+"do?action=CLASSSEARCH&SchoolID="+SchoolID;
}
function toUrl(){
	var SchoolID;
	var SchoolGradeID;
	SchoolID = document.form1.SchoolID.value;
	SchoolGradeID = document.form1.SchoolGradeID.value;
	var preFix;
	preFix = '<%=com.humyu.servlet.DispatcherServlet.PREFIX%>';
	location.href=preFix+"do?action=DOCLASSADD&SchoolID="+SchoolID+"&SchoolGradeID="+SchoolGradeID;
}
function delete_confirm(){
 if(confirm("删除后将不能恢复，您确认执行删除操作么？")==true){
	return true;
 }
 return false;
}
</script>
<link href="css/common.css" rel="stylesheet" type="text/css">
</head>
<body>
<p align="center"><strong>班级管理</strong></p>
<form name="form1" method="post" action="<%=com.humyu.servlet.DispatcherServlet.PREFIX%>do" target="mainFrame">
  <table width="100%"  border="0" cellspacing="0" cellpadding="0">
    <tr>
      <td width="28%"><strong>学校：</strong>        <select name="SchoolID" onChange="getGrades()">
        <option value="-1" selected>请选择学校</option>
		<%=strHtml%>
      </select></td>
      <td width="26%"><strong>年级：</strong>        <select name="SchoolGradeID">
        <option value="-1" selected>请选择年级</option>
		<%=strHtml1%>
                    </select>
        <input name="action" type="hidden" id="action" value="CLASSSEARCH"></td>
      <td width="16%"><input type="submit" name="Submit" value="查询"></td>
      <td width="30%"><a href='#'  target='mainFrame' onClick='toUrl()'>添加班级信息</a></td>
    </tr>
  </table>
  
</form>
<table width="100%"  border="1" cellpadding="0" cellspacing="0" bordercolor="#BBD1FC">
  <tr align='center' bgcolor='#CCCCFF'> 
    <td width="20%"><STRONG>学校编号</STRONG></td>
    <td width="10%"><STRONG>年级编号</STRONG></td>
    <td width="10%"><STRONG>班级编号</STRONG></td>
    <td width="15%"><STRONG>班级名称</STRONG></td>
    <td width="15%"><STRONG>创建时间</STRONG></td>
    <td width="10%"><strong>参数</strong></td>
    <td width="10%"><strong>修改</strong></td>
    <td width="10%"><strong>删除</strong></td>
  </tr>
  <%
	if(iteratorClasses!=null){
		com.humyu.school.corebase.Class c = null;
		while(iteratorClasses.hasNext()){
			c = (com.humyu.school.corebase.Class)iteratorClasses.next();
			out.println("<tr align='center'>");
    		out.println("<td>"+c.getSchoolID()+"</td>");
  			out.println("<td>"+c.getSchoolGradeID()+"</td>");
    		out.println("<td>"+c.getSchoolClassID()+"</td>");
    		out.println("<td>"+c.getSchoolClassName()+"</td>");
    		out.println("<td>"+StringUtil.FormatDatetime(c.getSchoolClassCreateTime())+"</td>");
          	out.println("<td width='10%'><font color='#0000FF'><a href=" +
                         com.humyu.servlet.DispatcherServlet.PREFIX +
                         "a_schoolclasspars.jsp?SchoolID=" +
                         c.getSchoolID() + "&SchoolClassID=" +
                         c.getSchoolClassID() + ">参数</a></font></td>");
    		out.println("<td><a href=" +
                           com.humyu.servlet.DispatcherServlet.PREFIX +
                           "do?action=DOCLASSMOD&SchoolID=" +
                           c.getSchoolID() +
                           "&SchoolGradeID=" + c.getSchoolGradeID() +
                           "&SchoolClassID=" +
                           c.getSchoolClassID() + ">修改</a></td>");
    		out.println("<td><a href=" +
                           com.humyu.servlet.DispatcherServlet.PREFIX +
                           "do?action=CLASSDEL&SchoolID=" +
                           c.getSchoolID() +
                           "&SchoolGradeID=" + c.getSchoolGradeID() +
                           "&SchoolClassID=" +
                           c.getSchoolClassID() + " onclick='return delete_confirm();'>删除</a></td>");
  			out.println("</tr>");
		}
	}
%>
</table>

<p align="center"> 
  <input type="button" name="Button" value="刷　新" onClick="history.go(0)">
</p>
</body>
</html>
